import java.util.Scanner;

/**
 *  十进制转换十六进制
 */
public class DecimaltoHexadecimal {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        if(x == 0) {
            System.out.println(0);
            System.exit(0);
        }
        StringBuffer a = new StringBuffer(8);
        char b[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
        while (x != 0){
            a = a.append(b[x%16]);
            x /= 16;
        }
        System.out.println(a.reverse().toString());
    }
}
